﻿using IT_RoadBlock.ViewModes;
using HandyControl.Controls;
using System.Windows;
using System.Windows.Controls;

namespace IT_RoadBlock.Controls
{
    public partial class ProjectUseControl:UserControl
    {
        public ProjectUseControl()
        {
            InitializeComponent();
            this.DataContext = new ProjectPageViewModel()
            {
                DialogWindow = (win, rs) => Dialog.Show(new TextDialog(win, rs)),
                OpenEditWindow = (it) =>
                {
                    ProjectEditWindow editWindow = new ProjectEditWindow(it??new Entities.TProjectInfo());
                    editWindow.ResizeMode = ResizeMode.NoResize;
                    editWindow.WindowStartupLocation = System.Windows.WindowStartupLocation.CenterScreen;
                    editWindow.ShowDialog();
                }
            };
        }

    }
}
